package cn.wellwan.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.client.RestTemplate;

import java.util.*;

/**
 * Copyright (C),微动天下
 * FileName: WellwanHttpMessageConverter
 * Author:   maokai
 * Date:     2018/12/25 14:41
 * Description: 转换器
 */
public class WellwanHttpMessageConverter extends MappingJackson2HttpMessageConverter {

    public WellwanHttpMessageConverter(){
        List<MediaType> mediaTypes = new ArrayList<>();
        mediaTypes.add(MediaType.TEXT_PLAIN);
        mediaTypes.add(MediaType.TEXT_HTML);
        mediaTypes.add(MediaType.APPLICATION_FORM_URLENCODED);
        mediaTypes.add(MediaType.valueOf("application/x-www-form-urlencoded;charset=UTF-8"));
        setSupportedMediaTypes(mediaTypes);

    }

}
